<template>
  <div>
        <h1>我是第三个组件</h1>
        <h1>分模块的state:</h1>
        <!-- $store.state.分模块名.属性 -->
        <h1 v-for="item in $store.state.threeStore.list" :key="item">
          {{item}}
        </h1>
           <button @click="toChange">触发分模块的mutations</button>
           <button @click="toAct">触发分模块的actions</button>
           <!-- $store.getters['分模块名/属性'] -->
         <h1 v-for="item in $store.getters['threeStore/listget']" :key="item">
          {{item}}
        </h1>
  </div>
</template>

<script>
export default {
  name: '2304BAddressThree',

  data() {
    return {
      
    };
  },

  mounted() {
    
  },

  methods: {
    toChange(){
      // 触发分模快mutations
      this.$store.commit("threeStore/add","王源")
    },
    toAct(){
      // 触发分模块的 actions 
      this.$store.dispatch("threeStore/actList","易烊千玺")

    }
  },
};
</script>